package com.sky.controller.user;

import com.sky.dto.UserLoginDTO;
import com.sky.result.Result;
import com.sky.service.UserService;
import com.sky.vo.UserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author : xiongke
 * @Description:
 * @Date: 2024/8/29
 */
@RequestMapping("/user/user")
@Api(tags = "用户相关接口")
@RestController
@Slf4j
public class UserController {

    @Resource
    UserService userService;

    @PostMapping("/login")
    @ApiOperation("微信登录接口")
    public Result<UserLoginVO> wxLogin(@RequestBody UserLoginDTO dto){
        log.info("微信登录：{}",dto.getCode());
        UserLoginVO vo = userService.wxLogin(dto);
        return Result.success(vo);
    }

}
